<?php
namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\Redis;

class ApiTokenCheck
{
    public function handle($request, Closure $next) {
        $token = request()->header('Access-Token','');
        //完善中
        // if(!$token){
        //     return out(777,'token错误！');
        // }

        // $redis = Redis::connection('public');
        // $rootUrl = request()->root();
        // $ip = request()->ip();
        // $key = 'apiToken'.$rootUrl.$ip;
        // $tokenR = $redis->get($key);
        // if($token !== $tokenR){
        //     return out(777,'token错误！');
        // }
        return $next($request);
    }
}

